#include"sort.h"

void TestInsert()
{
	int a[] = { 9,8,7,6,5,4,3,2,1 };
	int n = sizeof(a) / sizeof(int);

	InsertSort(a, n);

	Print(a, n);
}
void TestShell()
{
	int a[] = { 9,8,7,6,5,4,3,2,1 };
	int n = sizeof(a) / sizeof(int);

	ShellSort(a, n);

	Print(a, n);
}

void TestSelect()
{
	int a[] = { 9,8,7,6,5,4,3,2,1 };
	int n = sizeof(a) / sizeof(int);

	SelectSort(a, n);

	Print(a, n);
}

void TestHeap()
{
	int a[] = { 9,8,7,6,5,4,3,2,1, };
	int n = sizeof(a) / sizeof(int);

	HeapSort(a, n);

	Print(a, n);
}

void TestBubble()
{
	int a[] = { 1,2,3,4,5,6,7,8,9 };
	int n = sizeof(a) / sizeof(int);

	BubbleSort(a, n);

	Print(a, n);
}

void TestQuick()
{
	//int a[] = { 9,8,7,6,5,4,3,2,1, };
	//int n = sizeof(a) / sizeof(int);

	int a[30];
	for (int i = 0; i < 30; i++)
	{
		a[i] = rand() % 100;
	}

	//QuickSort(a, 0, 29);
	QuickSortNonR(a, 0, 29);

	Print(a, 29);
}

void TestMerge()
{
	/*int a[] = { 9,8,7,6,5,4,3,2,1, };
	int n = sizeof(a) / sizeof(int);
	MergeSortNonR(a, n);
	Print(a, n);*/


	int a[30];
	for (int i = 0; i < 30; i++)
	{
		a[i] = rand() % 100;
	}
	//MergeSort(a, 30);
	MergeSortNonR(a, 30);
	Print(a, 30);
}
void TestCount()
{
	/*int a[] = { 9,8,7,6,5,4,3,2,1, };
	int n = sizeof(a) / sizeof(int);
	CountSort(a, n);
	Print(a, n);*/


	int a[30];
	for (int i = 0; i < 30; i++)
	{
		a[i] = rand() % 100;
	}
	CountSort(a, 30);
	Print(a, 30);
}

int main()
{
	srand((size_t)time(NULL));
	//TestInsert();
	//TestShell();
	//TestSelect();
	//TestHeap();
	//TestBubble();
	//TestQuick();
	TestCount();

	return 0;
}